import Request from '@/utils/requset.js'
let request = new Request().http

//全局定义请求头
export default {


	getChoice: function(data) {
		return request({
			url: "/api/getchoice", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	getTrain: function(data) {
		return request({
			url: "/api/getrain", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},

	// 请求 个人信息
	getpsxsonal: function(data) {
		return request({
			url: "/api/getpsxsonal", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},


	getOffline: function(data) {
		return request({
			url: "/api/getoffline", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},


	// 添加 个人信息
	addpsxsonal: function(data) {
		return request({
			url: '/api/addpsxsonal',
			method: 'POST',
			data: data,
		})
	},
	// 请求 知名导师
	getpsxtutor: function(data) {
		return request({
			url: "/api/getpsxtutor", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},


	searchTutor: function(data) {
		return request({
			url: `/api/gettutor/${data.name}`,
			method: 'GET',
			data: data,
		})
	},

	searchTutor1: function(data) {
		return request({
			url: `/api/gettutor1/${data.teacherid}`,
			method: 'GET',
			data: data,
		})
	},
	searchTutor2: function(data) {
		return request({
			url: `/api/gettutor2/${data.idnum}`,
			method: 'GET',
			data: data,
		})
	},

	searchTutor3: function(data) {
		return request({
			url: `/api/gettutor3/${data.region}`,
			method: 'GET',
			data: data,
		})
	},
	getTutorList: function(data) {
		return request({
			url: "/api/gettutorList", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	// 请求 问答个人信息
	getpsxapply: function(data) {
		return request({
			url: "/api/getpsxapply", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},

	searchTutor4: function(data) {
		return request({
			url: `/api/searchtutor/${data.id}`,
			method: 'GET',
			data: data,
		})
	},
	// 请求 积分信息
	getpsxintegral: function(data) {
		return request({
			url: "/api/getpsxintegral", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	// 添加 问答个人信息
	addpsxapply: function(data) {
		return request({
			url: '/api/addpsxapply',
			method: 'POST',
			data: data,
		})
	},
	getpsxdata: function(data) {
		return request({
			url: '/api/getpsxdata',
			method: 'GET',
			data: data,
		})
	},

	upOffline: function(data) {
		return request({
			url: `/api/upoffline/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},
	upPsxdata: function(data) {
		return request({
			url: `/api/putpsxdata/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},

	seOffline: function(data) {
		return request({
			url: `/api/seoffline/${data.id}`,
			method: 'GET',
			data: data,
		})
	},
	// 更新 积分
	putpsxintegral: function(data) {
		console.log(data);
		return request({
			url: `/api/putpsxintegral/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},
	// 获取 积分明细
	getpsxpsxdetil: function(data) {
		return request({
			url: '/api/getpsxpsxdetil',

			method: 'GET',
			data: data,
		})
	},


	// 添加 积分明细
	addpsxdetil: function(data) {
		return request({
			url: '/api/addpsxdetil',
			method: 'POST',
			data: data,
		})
	},
	//查找 积分明细
	seapsxdetil: function(data) {
		return request({
			url: `/api/psxdetil/${data.id}`,
			method: 'GET',
			data: data,
		})
	},

	// 是否成为专家
	getMjtQuestion: function() {
		return request({
			url: "/api/mjtquestion",
			method: "GET"
		})
	},
	putMjtQuestion: function(data) {
		return request({
			url: `/api/mjtquestion/${data.id}`,
			method: "put",
			data
		})
	},
	// 提问
	getMjtSpeak: function() {
		return request({
			url: "/api/mjtspeak",
			method: "GET"
		})
	},
	getMjtSpeakUid: function(uid) {
		return request({
			url: `/api/mjtspeak/uid/${uid}`,
			method: "GET"
		})
	},
	getMjtSpeakIsOpen: function(isopen) {
		return request({
			url: `/api/mjtspeak/isopen/${isopen}`,
			method: "GET"
		})
	},
	postMjtSpeak: function(data) {
		return request({
			url: "/api/mjtspeak",
			method: "post",
			data
		})
	},
	putMjtSpeak: function(data) {
		return request({
			url: `/api/mjtspeak/${data.id}`,
			method: "put",
			data
		})
	},
	// 搜索历史
	getMjtSearchHistory: function() {
		return request({
			url: "/api/mjtsearchhistory",
			method: "GET"
		})
	},
	deleteMjtSearchHistory: function(id) {
		return request({
			url: `/api/mjtsearchhistory/${id}`,
			method: "delete"
		})
	},
	postMjtSearchHistory: function(data) {
		return request({
			url: "/api/mjtsearchhistory",
			method: "post",
			data
		})
	},
	// 热门搜索
	getMjtHotSearch: function() {
		return request({
			url: "/api/mjthotsearch",
			method: "GET"
		})
	},
	// 医生列表
	getMjtDoctor: function() {
		return request({
			url: "/api/mjtdoctor",
			method: "GET"
		})
	},
	getMjtDoctorId: function(id) {
		return request({
			url: `/api/mjtdoctor/id/${id}`,
			method: "GET"
		})
	},
	getMjtDoctorFenlei: function(fenlei) {
		return request({
			url: `/api/mjtdoctor/fenlei/${fenlei}`,
			method: "GET"
		})
	},
	getMjtDoctorDepartment: function(doctorFenlei) {
		return request({
			url: `/api/mjtdoctor/doctorFenlei/${doctorFenlei}`,
			method: "GET"
		})
	},
	getMjtDoctorName: function(doctorName) {
		return request({
			url: `/api/mjtdoctor/doctorName/${doctorName}`,
			method: "GET"
		})
	},
	// 关注列表
	getMjtGuanzhu: function() {
		return request({
			url: "/api/mjtguanzhu",
			method: "GET"
		})
	},
	postMjtGuanzhu: function(data) {
		return request({
			url: "/api/mjtguanzhu",
			method: "post",
			data
		})
	},
	getMjtGuanzhuUid: function(uid) {
		return request({
			url: `/api/mjtguanzhu/${uid}`,
			method: "GET"
		})
	},
	deleteMjtGuanzhu: function(id) {
		return request({
			url: `/api/mjtguanzhu/${id}`,
			method: "delete"
		})
	},

	lfycourse: function(data) {
		return request({
			url: "/api/lfycourse", //请求头
			method: "GET", //请求方式
			// data: data, //请求数据
		})
	},
	lfycoursetopic: function(data) {
		return request({
			url: "/api/lfycoursetopic", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	lfycoursediscuss: function(data) {
		return request({
			url: "/api/lfycoursediscuss", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	// 发布话题
	lfyAddDiscuss: function(data) {
		return request({
			url: '/api/lfyadddiscuss',
			method: 'POST',
			data: data,
		})
	},
	// 查找讨论
	searchDiscuss: function(data) {
		return request({
			url: `/api/lfycoursediscuss/${data.id}`,
			method: 'GET',
			data: data,
		})
	},
	// 查找讨论
	// searchDis: function(data) {
	// 		return request({
	// 			url: `/api/lfysearchdiscuss/${data.id}`,
	// 			method: 'GET',
	// 			data: data,
	// 		})
	// 	},

	lfyanswer: function(data) {
		return request({
			url: "/api/lfyanswer", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	// 查找回答
	searchAnswer: function(data) {
		return request({
			url: `/api/lfyanswer/${data.id}`,
			method: 'GET',
			data: data,
		})
	},

	// 添加回答
	lfyAddAnswer: function(data) {
		return request({
			url: '/api/lfyaddanswer',
			method: 'POST',
			data: data,
		})
	},

	// 点赞
	upThumb: function(data) {
		return request({
			url: `/api/lfythumbanswer/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},

	lfyanswerdis: function(data) {
		return request({
			url: "/api/lfyanswerdis", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},

	// 回答评论
	lfyAddAnsdis: function(data) {
		return request({
			url: '/api/lfyaddanswerdis',
			method: 'POST',
			data: data,
		})
	},

	// 评论点赞
	upThumbDis: function(data) {
		return request({
			url: `/api/lfythumbdis/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},
	lfycoursepj: function(data) {
		return request({
			url: "/api/lfycoursepj", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},

	// 评价
	lfyAddpj: function(data) {
		return request({
			url: '/api/lfyaddpj',
			method: 'POST',
			data: data,
		})
	}

}


/*
// 请求模板
请求样式：
    自定义名字: function(data) {
        return request({
            url: "/banner", //请求头
            method: "GET", //请求方式 
            data: data,    //请求数据
            token: token, // 可传  
            hideLoading: false, //加载样式
        })
    },
*/
/*

// 获取
	getMsg: function(data) {
		return request({
			url: "/api/yytadress", //请求头
			method: "GET", //请求方式
			data: data, //请求数据
		})
	},
	// 删除
	delMsg: function(data) {
		return request({
			url: `/api/yytdelbanner/${data.id}`,
			method: 'DELETE',
			data: data,
		})
	},

	// 更新
	upMsg: function(data) {
		return request({
			url: `/api/yytupbanner/${data.id}`,
			method: 'PUT',
			data: data,
		})
	},
	// 查找
	searchMsg: function(data) {
		return request({
			url: `/api/yytbanner/${data.id}`,
			method: 'GET',
			data: data,
		})
	}*/
